﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;

namespace DevOnServer
{
    public enum AttackFlags
    {
        Normal = 0x00000000,
        Miss = 0x00000002,
        Critical = 0x00000040,
        Parry = 0x00000200,
        Block = 0x00001000
    }

    public enum DeathType
    {
        Mob,
        Player,
        PvP,
        PK,
        Special
    }

    public class CAttackResult
    {
        public int Damage;

        public int Flags;

        public bool Kill;
    }

    public abstract class CCreature : CMover
    {
        public CCreature(int id, CWorld world, CMoverProp prop)
            : base(id, world, prop)
        {
        }

        public bool IsAlive
        {
            get
            {
                return HP > 0;
            }
        }

        public int HP;

        protected CAttackResult m_attackResult = new CAttackResult();

        public virtual CAttackResult attack(CCreature target, int attackMotion = 30)
        {
            return m_attackResult;
        }

        public virtual void damage(CAttackResult attackResult, CCreature attacker)
        {
        }

        public virtual void kill(DeathType death, CCreature killer)
        {
        }
    }
}